﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using QLCONGNOLIBS.Securities;


namespace QLCONGNOLIBS.Controllers
{
    public class UsersControllers
    {
        private SqlConnection m_objConnection;
        private SecurityEntity m_objSecurity;
        private QLCONGNOLIBS.Models.UsersModels m_objUserModels;

        public UsersControllers(SqlConnection objConnection, SecurityEntity objSecurity)
        {
            m_objConnection = objConnection;
            m_objSecurity = objSecurity;
            m_objUserModels = new QLCONGNOLIBS.Models.UsersModels(objConnection, m_objSecurity);
        }

        public QLCONGNOLIBS.Models.DbSetQLCNEn.tblUsersDataTable getUsers()
        {
            return m_objUserModels.GetElements();
        }

        public DataTable CheckLogin(string userName, string passWord) {
            return m_objUserModels.CheckElement(userName, passWord);
        } 
    }
}
